<template>
	<view>
		<u-navbar immersive :background="background" title-color="#fff" title="订单详情" :border-bottom="false" back-icon-color="#fff"></u-navbar>
		<view class="money">
			<u-image src="https://photo.hiyipin.net/USER/64d86d1e-a49f-4936-81fd-f977a146d19b.png" mode="widthFix" width="750"></u-image>
			<view class="text">
				<view class="icon">
					<u-icon size="60" color="#fff" name="checkmark-circle-fill"></u-icon>
				</view>
				<view class="money-info">
					<view><text>￥</text>560.58</view>
					<view>已完成</view>
				</view>
			</view>
		</view>

		<view class="card">
			<view class="title">商家/订单信息</view>
			<view class="info">
				<view>交易单号：354351000055656652</view>
				<view>下单时间：2020-12-15 15:05:58</view>
				<view>油站名称：品牌优选-金田加油站</view>
				<view>地址：深圳市龙岗区坂田街道吉华路679号</view>
			</view>
		</view>
		<view class="card">
			<view class="title">商品信息</view>
			<view class="info">
				<view>油号/枪号：92#/2号枪</view>
				<view>油站价：￥5.78</view>
				<view>加油升数：实际升数以油站加油机为准1.73升</view>
				<view>加油金额：￥10.00</view>
				<view>支付方式：微信支付</view>
			</view>
		</view>
		
		<view class="btn-box">
			<view class="btn" @click="submit">
				申请退款
			</view>
			<view class="safe-area-inset-bottom"></view>
		</view>
		<view class="safe-area-inset-bottom"></view>
		<u-gap height="130"></u-gap>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: {
					backgroundImage: 'linear-gradient(90deg, rgba(253, 49, 41, ' + 0 + '), rgba(255, 77, 70, ' + 0 + '))'
				},
			};
		},
		onLoad() {
			this.opacity = 0
		},
		onPageScroll({
			scrollTop
		}) {
			var opacity = 0,
				maxNumber = uni.getSystemInfoSync().statusBarHeight + 44
			if (scrollTop <= maxNumber) {
				opacity = scrollTop / maxNumber
			} else {
				opacity = 1
			}
			if (opacity == this.opacity) return
			this.opacity = opacity
			this.background = {
				backgroundImage: 'linear-gradient(90deg, rgba(253, 49, 41, ' + this.opacity + '), rgba(255, 77, 70, ' + this.opacity +
					'))'
			}
		},
	}
</script>

<style lang="scss">
	.btn-box {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		background: linear-gradient(90deg, #FD3129, #FF4D46);
		border-radius: 40rpx 40rpx 0px 0px;
		z-index: 10;
	
		.btn {
			text-align: center;
			line-height: 100rpx;
			font-size: 30rpx;
			color: #fff;
		}
	}
	page {
		background-color: #F9F9F9;
		// height: 2000px;
	}

	.card {
		background-color: #FFFFFF;
		border-radius: 20rpx;
		margin: 0 30rpx;
		margin-top: 30rpx;

		.info {
			padding: 20rpx 0;

			>view {
				padding: 20rpx 30rpx;
			}
		}

		.title {
			line-height: 80rpx;
			font-weight: bold;
			padding: 0 30rpx;
			border-bottom: 1rpx solid #F7F7F7;
		}
	}

	.money {
		position: relative;

		.text {
			position: absolute;
			left: 30rpx;
			bottom: 30rpx;
			display: flex;
			align-items: flex-start;

			.icon {
				margin-right: 20rpx;
				padding-top: 10rpx;
			}

			.money-info {
				color: #FFFFFF;

				>view {
					&:last-child {
						font-size: 30rpx;
					}

					&:first-child {
						text {
							font-size: 30rpx;
							font-weight: normal;
						}

						font-size: 60rpx;
						font-weight: bold;
					}
				}
			}
		}
	}
</style>
